package com.nd.controller.wx;

import com.nd.pojo.vo.wx.BaseRespWXVo;
import com.nd.service.wx.SelectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: project2mall
 * @description: 前端搜索控制器
 * @author: shit_code_builder
 * @create: 2021-06-08 22:03
 **/

@RestController
@RequestMapping("wx")
public class WXSelectController {
    @Autowired
    SelectService selectService;

    @GetMapping("/search/index")
    public BaseRespWXVo selectIndex(){
        BaseRespWXVo baseRespWXVo= selectService.index();
        return baseRespWXVo;
    }

    @GetMapping("/search/helper")
    public BaseRespWXVo selectHelper(String keyword){
        BaseRespWXVo baseRespWXVo= selectService.helper(keyword);
        return baseRespWXVo;
    }


    @PostMapping("/search/clearhistory")
    public BaseRespWXVo DeleteHistory(){
        BaseRespWXVo baseRespWXVo= selectService.deletehistory();
        return baseRespWXVo;
    }


}
